<?php
$name = $_GET['name'];
$pwd = $_GET['pwd'];
$con = mysqli_connect('localhost', 'root', 'root');

    // 2、选择要操作的数据库
    mysqli_select_db($con, '2004');

    // 3、设置编码
    mysqli_query($con, "set charset 'utf8'");
    mysqli_query($con, "set character set 'utf8'");

    $sql = "select * from users where name='$name' and pwd ='$pwd'";
    $res = mysqli_query($con, $sql);
    if($res) {
        echo json_encode(array(
            "code" => 200,
            "list" => array (
                "msg" => "录入商品成功"
            )
            ));
    }else{
        echo json_encode(array(
            "code" => 0,
            "list" => array(
                "msg" => "网络错误，请重试"
            )
            ));
    }


?>